home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / graphics / jpeg4bin.zoo / cjpeg.1 next >
Text File  |  1993-01-17  |  9KB  |  203 lines

  1. CJPEG(1)                 USER COMMANDS                   CJPEG(1)
  2.  
  3.  
  4.  
  5. NAME
  6.      cjpeg - compress an image file to a JPEG file
  7.  
  8. SYNOPSIS
  9.      cjpeg [ -quality _✓N ] [ -grayscale ] [ -optimize ] [ -targa ]
  10.      [ -maxmemory _✓N ] [ -restart _✓N ] [ -smooth _✓N ] [ -verbose ] [
  11.      -debug ] [ -arithmetic ] [ -nointerleave ] [ -qtables _✓f_✓i_✓l_✓e ]
  12.      [ -sample _✓H_✓x_✓V[,...] ] [ _✓f_✓i_✓l_✓e_✓n_✓a_✓m_✓e ]
  13.  
  14. DESCRIPTION
  15.      cjpeg compresses the named image file, or the standard input
  16.      if  no  file  is named, and produces a JPEG/JFIF file on the
  17.      standard output.  The currently supported input file formats
  18.      are:  PPM  (PBMPLUS  color  format), PGM (PBMPLUS gray-scale
  19.      format), GIF, Targa, and RLE (Utah Raster  Toolkit  format).
  20.      (RLE is supported only if the URT library is available.)
  21.  
  22. OPTIONS
  23.      All switch names may be abbreviated; for example, -grayscale
  24.      may  be  written -gray or -gr.  Most of the "basic" switches
  25.      can be abbreviated to as little as one  letter.   Upper  and
  26.      lower  case  are equivalent (thus -GIF is the same as -gif).
  27.      British spellings  are  also  accepted  (e.g.,  -greyscale),
  28.      though for brevity these are not mentioned below.
  29.  
  30.      The basic switches are:
  31.  
  32.      -quality _✓N
  33.           Scale quantization  tables  to  adjust  image  quality.
  34.           Quality  is  0  (worst)  to  100 (best); default is 75.
  35.           (See below for more info.)
  36.  
  37.      -grayscale
  38.           Create monochrome JPEG file from color input.  Be  sure
  39.           to  use  this  switch  when compressing a grayscale GIF
  40.           file, because  cjpeg  isn't  bright  enough  to  notice
  41.           whether a GIF file uses only shades of gray.  By saying
  42.           -grayscale, you'll get a smaller JPEG file  that  takes
  43.           less time to process.
  44.  
  45.      -optimize
  46.           Perform optimization of  entropy  encoding  parameters.
  47.           Without  this,  default  encoding  parameters are used.
  48.           -optimize usually makes the JPEG file a little smaller,
  49.           but  cjpeg  runs  somewhat  slower  and needs much more
  50.           memory.  Image quality and speed of  decompression  are
  51.           unaffected by -optimize.
  52.  
  53.      -targa
  54.           Input file is Targa format.  Targa files  that  contain
  55.           an  "identification"  field  will  not be automatically
  56.           recognized by cjpeg; for such files  you  must  specify
  57.           -targa to make cjpeg treat the input as Targa format.
  58.  
  59.      The -quality switch lets you trade off compressed file  size
  60.      against  quality  of the reconstructed image: the higher the
  61.      quality setting, the larger the JPEG file,  and  the  closer
  62.      the  output  image  will be to the original input.  Normally
  63.      you want to use the lowest quality setting  (smallest  file)
  64.      that  decompresses into something visually indistinguishable
  65.      from the original image.  For this purpose the quality  set-
  66.      ting should be between 50 and 95; the default of 75 is often
  67.      about right.  If you see defects at -quality 75, then go  up
  68.      5 or 10 counts at a time until you are happy with the output
  69.      image.  (The optimal setting will vary  from  one  image  to
  70.      another.)
  71.  
  72.      -quality 100 will generate a quantization table of all  1's,
  73.      eliminating  loss  in  the  quantization  step (but there is
  74.      still information loss in subsampling, as well  as  roundoff
  75.      error).  This setting is mainly of interest for experimental
  76.      purposes.  Quality values above about 95 are not recommended
  77.      for  normal  use;  the compressed file size goes up dramati-
  78.      cally for hardly any gain in output image quality.
  79.  
  80.      In the other direction, quality values below 50 will produce
  81.      very small files of low image quality.  Settings around 5 to
  82.      10 might be useful in preparing an index of  a  large  image
  83.      library, for example.  Try -quality 2 (or so) for some amus-
  84.      ing Cubist effects.  (Note: quality values  below  about  25
  85.      generate  2-byte  quantization  tables, which are considered
  86.      optional in the JPEG standard.  cjpeg emits a  warning  mes-
  87.      sage  when  you give such a quality value, because some com-
  88.      mercial JPEG programs may be unable to decode the  resulting
  89.      file.)
  90.  
  91.      Switches for advanced users:
  92.  
  93.      -maxmemory _✓N
  94.           Set limit for amount of memory  to  use  in  processing
  95.           large  images.  Value is in thousands of bytes, or mil-
  96.           lions of bytes if "M" is attached to the  number.   For
  97.           example,  -max 4m selects 4000000 bytes.  If more space
  98.           is needed, temporary files will be used.
  99.  
  100.      -restart _✓N
  101.           Emit a JPEG restart marker every N MCU rows, or every N
  102.           MCU  blocks if "B" is attached to the number.  -restart
  103.           0 (the default) means no restart markers.
  104.  
  105.      -smooth _✓N
  106.           Smooth the input image to  eliminate  dithering  noise.
  107.           N,  ranging  from  1  to 100, indicates the strength of
  108.           smoothing.  0 (the default) means no smoothing.
  109.  
  110.      -verbose
  111.           Enable debug printout.  More  -v's  give  more  output.
  112.           Also, version information is printed at startup.
  113.  
  114.      -debug
  115.           Same as -verbose.
  116.  
  117.      The -restart option inserts extra markers that allow a  JPEG
  118.      decoder   to   resynchronize  after  a  transmission  error.
  119.      Without restart markers, any damage  to  a  compressed  file
  120.      will  usually  ruin the image from the point of the error to
  121.      the end of the image; with restart markers,  the  damage  is
  122.      usually  confined to the portion of the image up to the next
  123.      restart marker.  Of course, the restart markers occupy extra
  124.      space.   We  recommend  -restart  1  for images that will be
  125.      transmitted across unreliable networks such as Usenet.
  126.  
  127.      The -smooth option filters the input to eliminate fine-scale
  128.      noise.   This  is  often useful when converting GIF files to
  129.      JPEG: a moderate smoothing factor of 10 to 50  gets  rid  of
  130.      dithering patterns in the input file, resulting in a smaller
  131.      JPEG file and a better-looking image.  Too large a smoothing
  132.      factor will visibly blur the image, however.
  133.  
  134.      Switches for wizards:
  135.  
  136.      -arithmetic
  137.           Use arithmetic coding rather than Huffman coding.  (Not
  138.           currently supported for legal reasons.)
  139.  
  140.      -nointerleave
  141.           Generate noninterleaved JPEG file (not yet supported).
  142.  
  143.      -qtables _✓f_✓i_✓l_✓e
  144.           Use the quantization  tables  given  in  the  specified
  145.           file.   The  file should contain one to four tables (64
  146.           values each) as plain text.  Comments preceded  by  '#'
  147.           may be included in the file.  The tables are implicitly
  148.           numbered 0,1,etc.  If -quality N is also specified, the
  149.           values  in  the  file  are  scaled according to cjpeg's
  150.           quality scaling curve.
  151.  
  152.      -sample _✓H_✓x_✓V[,...]
  153.           Set JPEG sampling factors.  If you  specify  fewer  H/V
  154.           pairs  than  there  are  components, the remaining com-
  155.           ponents are set to 1x1 sampling.  The  default  setting
  156.           is equivalent to -sample 2x2.
  157.  
  158.      The "wizard" switches are intended for experimentation  with
  159.      JPEG.  If you don't know what you are doing, don't use them.
  160.      You can easily produce files with worse image quality and/or
  161.      poorer   compression   than  you'll  get  from  the  default
  162.      settings.  Furthermore, these switches should  not  be  used
  163.      when  making files intended for general use, because not all
  164.      JPEG implementations will  support  unusual  JPEG  parameter
  165.      settings.
  166.  
  167. EXAMPLES
  168.      This example compresses the PPM file foo.ppm with a  quality
  169.      factor of 60 and saves the output as foo.jpg:
  170.  
  171.           cjpeg -quality _✓6_✓0 _✓f_✓o_✓o._✓p_✓p_✓m > _✓f_✓o_✓o._✓j_✓p_✓g
  172.  
  173. ENVIRONMENT
  174.      JPEGMEM
  175.           If this environment variable is set, its value  is  the
  176.           default  memory  limit.   The  value  is  specified  as
  177.